sap.ui.define([
	"sap/ui/core/mvc/Controller",
	"sap/m/MessageToast",
	"sap/ui/model/odata/v2/ODataModel" // Assuming this is needed for OData operations
], function (Controller, MessageToast, ODataModel) {
	"use strict";

	return Controller.extend("ui5.walkthrough.controller.App", {
		onHelloWorldPress: function () {
			MessageToast.show("Hello " + this.getView().getModel().getProperty("/recipient/name") + "!");
		},
		async onOpenDialogPress() {
         // create dialog lazily
         this.oDialog ??= await this.loadFragment({
               name:"ui5.walkthrough.view.Hello"
         });      
         this.oDialog.open();
		},
		onCloseDialog: function () {
			this.oDialog.close();
		}
	});
});